<template>
    <div class="host">
    <van-search
    v-model="value"
    shape="round"
    background="#4fc08d"
    placeholder="请输入店铺/商品"
    />
    <van-swipe
      class="my-swipe"
      :autoplay="1000"
      indicator-color="white"
    >
    <van-swipe-item v-for="(item, index) in swiper" :key="index">
        <img :src="item.bannerUrl" alt="" />
      </van-swipe-item>
    </van-swipe>

    <div class="title">猜你喜欢</div>
    <ul>
      <!-- <li  v-for="(item,index) in uls" :key="index" >{{item.lis}}</li> -->
      <li>综合排序</li>
      <li>距离最近</li>
      <li>销量最高</li>
      <li>筛选</li>
    </ul>
    <div class="mach">
      <span class="tem" v-for="(item, index) in muches" :key="index">{{
        item.mas
      }}</span>
    </div>
    <div class="nood" >
      <div class="goods" v-for="(item,index) in shoplist" :key="index">
        <img :src="item.picUrl" alt="" />
        <div class="left">
          <h3>{{ item.name }}</h3>
          <div class="top">
            <span class="love">{{ item.averagePriceTip }}</span>
            <span class="sell"> {{ item.monthSalesTip }}</span>
          </div>
          <div class="two">
            <span class="send">{{ item.minPriceTip }}</span>
            <span class="mend">{{ item.shippingFeeTip }}</span>
            <span class="center">{{ item.deliveryTimeTip }}</span>
            <span class="miter">{{ item.distance }}</span>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>

<script setup>
import { swiper_list, shop_list } from "../../api";
import { onMounted,ref } from 'vue'

var shoplist = ref([])
const value = ref('');
var swiper = ref([])
var muches = ref([
        { mas: "年货节热卖" },
        { mas: "津贴联盟" },
        { mas: "满减优惠" },
        { mas: "品质联盟" },
])
      
onMounted(() => {
    shop_list().then((res) => {
        console.log(shoplist);
        shoplist.value  = res.data.list
    }),
    swiper_list().then((res) => {
      swiper.value = res.data.list;
    });
})


</script>

<style scoped>
.my-swipe {
  margin: 10px;
  border-radius: 10px;
}
.my-swipe img {
  width: 100%;
  border-radius: 10px;
}
.title {
  font-weight: bolder;
  height: 25px;
  line-height: 20px;
}
ul {
  height: 30px;
  margin: auto;
  display: flex;
  justify-content: space-between;
}
.mach {
  width: 100%;
  height: 30px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}
h3 {
  font-size: 14px;
}
.tem {
  width: 24%;
  height: 100%;
  background-color: #ccc;
  text-align: center;
  /* line-height: 30px; */
}
.nood {
  width: 100%;
  height: 100px;
  /* border-bottom: 1px solid #000; */
}
.goods {
  width: 100%;
  height: 100%;
  display: flex;
  margin-top: 5px;
}
img {
  display: block;
  width: 70px;
  height: 70px;
}
.love {
  color: yellow;
}
.sell {
  display: inline-block;
  margin-left: 20px;
}
.send,
.mend,
.center {
  display: inline-block;
  margin-right: 5px;
}
.top {
  margin-top: 0px;
}
</style>